package com.orangeumbrella;

import com.guyj.base.ItemViewDelegate;
import com.guyj.base.ViewHolder;
import com.orangeumbrella.entity.TitleBean;

/**
 * 标题
 */
public class DelegateTitle implements ItemViewDelegate<Object> {
    @Override
    public int getItemViewLayoutId() {
        return R.layout.item_title;
    }

    @Override
    public boolean isForViewType(Object o, int i) {
        return o instanceof TitleBean;
    }

    @Override
    public void convert(ViewHolder viewHolder, Object o, int i) {
        viewHolder.setText(R.id.tv_title, ((TitleBean) o).getTitle());
        viewHolder.setOnItemChildClickListener(R.id.ll_root);
    }
}
